#pragma once
#include "widgets.h"
#include <QDialog>
#include <QMessageBox>

class QHBoxLayout;
class QVBoxLayout;
class QPushButton;
class S_WIDGETS_EXPORT SPopupWindow : public QDialog
{
public:
	SPopupWindow(QWidget* parent = nullptr);
	void setTitle(const QString&);

	QPushButton* addBtn(QMessageBox::StandardButton btnType, const QString&);
	QVBoxLayout* contentLayout() const { return m_contentLayout; }
protected:
	virtual void keyPressEvent(QKeyEvent*) override;
	virtual void mousePressEvent(QMouseEvent* event) override;
	virtual void mouseReleaseEvent(QMouseEvent* event) override;
	virtual void mouseMoveEvent(QMouseEvent* event) override;
	virtual void paintEvent(QPaintEvent* event) override;
	virtual void resizeEvent(QResizeEvent*) override;

private:
	QString	m_title;
	QHBoxLayout* m_btnLayout = nullptr;
	QVBoxLayout* m_contentLayout = nullptr;
	QPushButton* m_btnOK = nullptr;
	QPushButton* m_btnCancel = nullptr;
	QPushButton* m_btnApply = nullptr;
	bool		 m_dragging = false;
};